package com.yklab.library.util;

import android.app.Activity;

import com.yklab.library.R;


/**
 * describe:动画工具类
 * author:zhangcong
 * date:2017/5/6 22:10
 */
public class AnimUtils {


    /**
     * 动画效果,进入
     */
    public static void inAnim(Activity activity) {
        leftInTranslateAnim(activity);
    }

    /**
     * 动画效果,退出
     */
    public static void outAnim(Activity activity) {
        rightOutTranslateAnim(activity);
    }

    /**
     * 左右移动动画效果:左进
     */
    public static void leftInTranslateAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_push_left_in, R.anim.common_push_left_out);
    }

    /**
     * 左右移动动画效果:右出
     */
    public static void rightOutTranslateAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_push_right_in, R.anim.common_push_right_out);
    }

    /**
     * 上下移动动画效果:上进
     */
    public static void upInTranslateAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_in_from_top, R.anim.common_out_to_top);
    }

    /**
     * @Description: 从下进入
     */
    public static void bottomInTranslateAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_in_from_bottom, R.anim.common_push_down_out);
    }

    /**
     * 上下移动动画效果:下出
     */
    public static void downOutTranslateAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_push_static, R.anim.common_push_down_out);
    }

    /**
     * 淡入淡出动画效果
     */
    public static void fadeAlphaAnim(Activity activity) {
        activity.overridePendingTransition(R.anim.common_fade_in, R.anim.common_fade_out);
    }
}
